<template>
  <div>
    <el-table :data="memberlist" border style="width: 100%">
      <el-table-column prop="uid" label="会员编号" width="180"></el-table-column>
      <el-table-column prop="nickname" label="用户名称" width="180"></el-table-column>
      <el-table-column prop="rolename" label="手机号" width="180"></el-table-column>
      <el-table-column prop="password" label="密码" width="180"></el-table-column>
      <el-table-column label="状态">
        <template slot-scope="item">
          <div>
            <span v-if="item.row.status == 1">启用</span>
            <span v-else>禁用</span>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="item">
          <div>
            <el-button
              circle
              type="primary"
              icon="el-icon-edit"
              size="mini"
              @click="edit(item.row.uid)"
            ></el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { mapGetters, mapActions } from "vuex";
export default {
  data() {
    return {};
  },
  mounted() {
    //组件一加载就触发管理员列表调用的行动
    this.getMember();
  },
  computed: {
    ...mapGetters({
      memberlist: "member/getMemberList",
    }),
  },
  methods: {
    ...mapActions({
      getMember: "member/getMemberListAction",
    }),
    //封装一个编辑事件
    edit(uid) {
      this.$emit("edit", uid);
    },
  },
};
</script>

<style scoped>
</style>
